
/*
 * Copyright 2002-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2018原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans.factory;

/**
 * Interface to be implemented by beans that need to react once all their properties
 * have been set by a {@link BeanFactory}: e.g. to perform custom initialization,
 * or merely to check that all mandatory properties have been set.
 *
 * <p>An alternative to implementing {@code InitializingBean} is specifying a custom
 * init method, for example in an XML bean definition. For a list of all bean
 * lifecycle methods, see the {@link BeanFactory BeanFactory javadocs}.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @see DisposableBean
 * @see org.springframework.beans.factory.config.BeanDefinition#getPropertyValues()
 * @see org.springframework.beans.factory.support.AbstractBeanDefinition#getInitMethodName()
 */
/**
 *需要对所有财产进行一次性反应的bean要实现的接口
 *已由｛@link BeanFactory｝设置：例如，
 *或者只是检查所有强制财产是否都已设置。
 *
 *＜p＞实现｛@code InitializingBean｝的另一种方法是指定自定义
 *init方法，例如在XMLbean定义中。对于所有bean的列表
 *生命周期方法，请参见｛@link BeanFactory BeanFactory javadocs｝。
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 *@参见DisposableBean
 *@see org.springframework.beans.factory.config.BeanDefinition#getPropertyValues（）
 *@see org.springframework.beans.factory.support.AbstractBeanDefinition#getInitMethodName（）
 */
public interface InitializingBean {

	/**
	 * Invoked by the containing {@code BeanFactory} after it has set all bean properties
	 * and satisfied {@link BeanFactoryAware}, {@code ApplicationContextAware} etc.
	 * <p>This method allows the bean instance to perform validation of its overall
	 * configuration and final initialization when all bean properties have been set.
	 * @throws Exception in the event of misconfiguration (such as failure to set an
	 * essential property) or if initialization fails for any other reason
	 */
	/**
	 *在设置了所有bean财产后，由包含{@code BeanFactory}的调用
	 *并满足｛@link BeanFactoryAware｝、｛@code ApplicationContextAware｝等。
	 *＜p＞此方法允许bean实例执行其整体验证
	 *当所有bean财产都设置好后，进行配置和最终初始化。
	 *如果配置错误（例如未能设置
	 *基本属性），或者如果由于任何其他原因初始化失败
	 */
	void afterPropertiesSet() throws Exception;

}
